package com.lsa.expression;

import com.lsa.expression.parser.ParseException;
import com.lsa.expression.parser.poc.LLPocParser;
import com.lsa.expression.tree.Node;
import com.lsa.expression.visitor.EvalWalker;
import com.lsa.expression.visitor.PrintWalker;

public class Launcher
{
    /**
     * @param args
     */
    public static void main(String[] args)
    {
        LLPocParser parser = new LLPocParser();
        try
        {
            String expr = "(118*2)-(3+5)";
            System.out.println(expr);
            Node n = parser.parse(expr);
            PrintWalker.walk(n, 0);
            System.out.println(System.getProperty("line.separator") + expr+"="+EvalWalker.walk(n));
        }
        catch( ParseException e )
        {
           System.out.println("Syntax error:" + e.getMessage());
        }
    }
}
